#import "OmMineVCCardView.h"
@interface OmMineVCCardView ()
@property (nonatomic, strong) UIView *line0;
@property (nonatomic, strong) UIView *line1;
@end
@implementation OmMineVCCardView
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self configSelf];
        [self allocateComponents];
        [self layoutComponents];
    }
    return self;
}
- (void)configSelf {
    [self mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(RPX(345)));
        make.height.equalTo(@(RPX(90)));
    }];
    self.fp_cornerRadius(RPX(6)).fp_backgroundColor(HexadecimalColor(@"#FFFFFF"));
    self.layer.shadowColor = HexadecimalColor(@"#FEE5E8").CGColor;
    self.layer.shadowOffset = CGSizeMake(0,RPX(6));
    self.layer.shadowOpacity = 1;
    self.layer.shadowRadius = RPX(6);
}
- (void)allocateComponents {
    self.photosButton = [[OmBaseButton alloc] initWithImageName:@"OmPhotoButton"
                                                      imageSize:CGSizeMake(RPX(30), RPX(29))
                                               imageTopDistance:RPX(20)
                                                          title:ASLocalizedString(@"相册")
                                                      titleFont:RPXFont(14)
                                                     titleColor:[UIColor blackColor]
                                            titleBottomDistance:RPX(16)];
    [self addSubview:self.photosButton];
    self.giftsButton = [[OmBaseButton alloc] initWithImageName:@"OmGiftButton"
                                                      imageSize:CGSizeMake(RPX(26), RPX(30))
                                               imageTopDistance:RPX(20)
                                                          title:ASLocalizedString(@"礼物")
                                                      titleFont:RPXFont(14)
                                                     titleColor:[UIColor blackColor]
                                            titleBottomDistance:RPX(16)];
    [self addSubview:self.giftsButton];
    self.momentsButton = [[OmBaseButton alloc] initWithImageName:@"OmTwitterButton"
                                                      imageSize:CGSizeMake(RPX(30), RPX(25))
                                               imageTopDistance:RPX(20)
                                                          title:ASLocalizedString(@"新鲜事")
                                                      titleFont:RPXFont(14)
                                                     titleColor:[UIColor blackColor]
                                            titleBottomDistance:RPX(16)];
    [self addSubview:self.momentsButton];
    self.line0 = [[UIView alloc] init].fp_backgroundColor(HexadecimalColor(@"#F2F2F2"));
    [self addSubview:self.line0];
    self.line1 = [[UIView alloc] init].fp_backgroundColor(HexadecimalColor(@"#F2F2F2"));
    [self addSubview:self.line1];
}
- (void)layoutComponents {
    [self.photosButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(RPX(115)));
        make.height.equalTo(self);
        make.top.left.equalTo(self);
    }];
    [self.giftsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(RPX(115)));
        make.height.equalTo(self);
        make.top.equalTo(self);
        make.centerX.equalTo(self);
    }];
    [self.momentsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(@(RPX(115)));
        make.height.equalTo(self);
        make.top.right.equalTo(self);
    }];
    [self.line0 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).offset(RPX(115));
        make.width.equalTo(@(1));
        make.height.equalTo(@(RPX(75)));
    }];
    [self.line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.right.equalTo(self).offset(RPX(-115));
        make.width.equalTo(@(1));
        make.height.equalTo(@(RPX(75)));
    }];
}
@end
